import Vue from 'vue'
import App from './App.vue'
import store from './store'
import ECharts from 'vue-echarts'
import 'echarts'

(function (doc, win) {
  const docEl = doc.documentElement
  const size = 1920
  const resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
  const recalc = function () {
    const clientWidth = docEl.clientWidth
    if (!clientWidth) return
    docEl.style.fontSize = 16 * (clientWidth / size) + 'px'
  }
  if (!doc.addEventListener) return
  win.addEventListener(resizeEvt, recalc, false)
  doc.addEventListener('DOMContentLoaded', recalc, false)
})(document, window)

Vue.component('v-chart', ECharts)

Vue.config.productionTip = false

new Vue({
  store,
  render: h => h(App)
}).$mount('#app')
